<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>重生之我觉醒了流浪系统</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <link type="text/css" rel="stylesheet" href="css/public.css"/>
</head>
<body>
<!--头部-->
<div id="app">
    <div class="quan">
        <div id="div1">
            <img src="images/beijing2.jpg">
        </div>
        <header class="publicHeader">
            <h1>流狼家</h1>
            <div class="publicHeaderR">
                <p><span>下午好！</span><span style="color: #fff21b"> 系统管理员</span> , 欢迎你！</p>
                <a href="jsp/logout.do">退出</a>
            </div>
        </header>
        <!--时间-->
        <section class="publicTime">
            <span id="time">2015年1月1日 11:11  星期一</span>
            <a href="#">温馨提示：为了能正常浏览，请使用高版本浏览器！（IE10+）</a>
        </section>
        <!--主体内容-->
        <section class="publicMian ">
            <div class="left">
                <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>
                <nav>
                    <ul class="list">
                        <li><a href="animal.html">动物管理</a></li>
                        <li><a href="adoptive.html">领养者管理</a></li>
                        <li><a href="user.html">用户管理</a></li>
                        <li><a href="update_pass.html">密码修改</a></li>
                        <li><a href="login.html">退出系统</a></li>
                    </ul>
                </nav>
            </div>
            <input type="hidden" id="path" name="path" value="/SMBMS"/>
            <input type="hidden" id="referer" name="referer" value="http://localhost:8080jsp/bill.do?method=query"/>

            <div class="right">
                <div class="location">
                    <strong>你现在所在的位置是:</strong>
                    <span>动物管理页面 >> 动物添加页面</span>
                </div>
                <div class="providerAdd">

                    <!--div的class 为error是验证错误，ok是验证成功-->
                    <input type="hidden" name="method" value="add">
                    <div class="">
                        <label for="billCode">动物编码：</label>
                        <input type="text" name="billCode" class="text" id="billCode" v-model="animalCode">

                        <!-- 放置提示信息 -->
                        <font color="red"></font>
                    </div>
                    <div>
                        <label for="productName">动物名称：</label>
                        <input type="text" name="productName" id="productName" v-model="animalName">
                        <font color="red"></font>
                    </div>
                    <div>
                        <label for="gender">动物性别</label>
                        <select name="gender" id="gender" v-model="gender">
                        <option value="2">公</option>
                        <option value="1">母</option>
                            <font color="red"></font></select>
                    </div>
                    <div>
                        <label for="productCount">动物种类：</label>
                        <input type="text" name="productCount" id="productCount" v-model="type">
                        <font color="red"></font>
                    </div>
                    <div>
                        <label for="totalPrice">健康状况：</label>
                        <input type="text" name="totalPrice" id="totalPrice" v-model="health">
                        <font color="red"></font>
                    </div>
                    <div>
                        <label>出生日期：</label>
                        <input type="date" Class="Wdate" id="birthday" v-model="birthday" name="birthday">
                        <font color="red"></font>
                    </div>
                    <div>
                        <label>是否被领养：</label>
                        <input type="radio" name="isPayment" value="1" checked="checked" v-model="state">是
                        <input type="radio" name="isPayment" value="0" v-model="state">否
                    </div>
                    <div class="providerAddBtn">
                        <input type="button" name="add" id="add" value="保存" @click="saveAnimal">
                        <input type="button" id="back" name="back" value="返回" @click="goBack">
                    </div>

                </div>
            </div>
        </section>


        <footer class="footer">
            版权归汪汪队立大功
        </footer>
    </div>
</div>
<script type="text/javascript" src="js/time.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="calendar/WdatePicker.js"></script>
</body>
</html>
<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                animalCode: '',
                animalName: '',
                gender: 2,
                type: '',
                health: '',
                birthday: '',
                state: 0
            }
        },
        methods: {
            saveAnimal() {
                axios({

                    url: 'animal/save',
                    params: {
                        animalCode: this.animalCode,
                        animalName: this.animalName,
                        gender: this.gender,
                        type: this.type,
                        health: this.health,
                        birthday: this.birthday,
                        state: this.state

                    }
                }).then(resp => {
                    if (resp.data == 1) {
                        location.href = 'animal.html'
                    }
                })
            },
            goBack() {
                location.href = 'animal.html'
            }

        }
    })
</script>